
import java.util.*;
import static java.lang.Math.max;

public class test3 {

    public static long[] get_vis(){
        long[] vis=new long[200005];
        vis[1]=1;
        for(long i=2;i<=200000;i++)
        {
            if(vis[(int)i]==1)
                continue;
            for(long j=i*i;j<=200000;j+=i)
                vis[(int)j]=1;
        }
        return vis;
    }
    public static void main(String[] args) {
        long idx=0;
        long[] vis=get_vis();
        long[] ans=new long[200005];
        for(long i=1;i<=200000;i++){
            if(vis[(int)i]==0)
                ans[(int)(++idx)]=i;
        }
        for(long i=1;i<=idx;i++){
            System.out.printf("%d ",ans[(int)i]);
            if(i%5==0)
                System.out.println();
        }
    }
}
